Skip to content

feat(logs): extract forwarded_by attribute from syslog message body#1802

Merged
timojohlo merged 1 commit into
mainfrom
feat/syslog-forwarded-by-attribute
Jul 8, 2026
Merged

feat(logs): extract forwarded_by attribute from syslog message body#1802
timojohlo merged 1 commit into
mainfrom
feat/syslog-forwarded-by-attribute

Conversation

@timojohlo

Copy link
Copy Markdown
Member

Summary

  • Adds a transform/syslog_forwarded_by processor to the external-collector syslog pipelines that extracts forwarded_by=octobus_logstash from the message body into a proper structured attribute
  • Strips the marker text from both attributes["message"] and body to keep log messages clean

Context

Logs forwarded via the octobus Logstash relay have forwarded_by=octobus_logstash appended to the syslog message body (the only way to pass metadata with a line codec over TCP). This makes it impossible to filter/query on this field without full-text search.

This processor:

  1. Detects the marker in attributes["message"] (primary) or body (fallback for unparsed logs)
  2. Sets attributes["forwarded_by"] = "octobus_logstash" as a structured attribute
  3. Removes the marker from the message and body fields

Pipeline placement

Runs after the early drop filters (to avoid processing logs that will be discarded) and before user extraction/hostname parsing (so the marker doesn't interfere with other parsers):

filter/syslog_early_drop → filter/syslog_drop_verbose → transform/syslog_forwarded_by → transform/syslog_user_extraction → ...

Applied to all three syslog pipelines: TCP, UDP, and TCP+TLS.

Logs forwarded via Logstash have 'forwarded_by=octobus_logstash' appended
to the message body. This adds a transform processor that:
1. Detects the marker in attributes["message"] or body
2. Sets attributes["forwarded_by"] = "octobus_logstash"
3. Strips the marker text from both message and body

This allows filtering/querying on the forwarded_by attribute in OpenSearch
without relying on full-text search of the message field.
@timojohlo timojohlo requested a review from a team as a code owner July 8, 2026 13:27
Copilot AI review requested due to automatic review settings July 8, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new syslog transform processor in the external collector to extract the forwarded_by=octobus_logstash marker into a structured attributes["forwarded_by"] field and remove the marker from log message fields, enabling filtering without full-text search.

Changes:

  • Bumps the logs plugin and Helm chart versions to ship the updated syslog pipeline configuration.
  • Inserts transform/syslog_forwarded_by into all three external-collector syslog pipelines (TCP, UDP, TCP+TLS).
  • Defines the new transform/syslog_forwarded_by processor to set attributes["forwarded_by"] and strip the marker from attributes["message"] and body.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
logs/plugindefinition.yaml Bumps plugin and chart versions to publish the change.
logs/charts/Chart.yaml Bumps Helm chart version.
logs/charts/templates/_syslog-config.tpl Adds the new transform processor into the syslog pipelines’ processor chain.
logs/charts/templates/_syslog-audit-filter-config.tpl Introduces the transform/syslog_forwarded_by processor logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread logs/charts/templates/_syslog-audit-filter-config.tpl
@timojohlo timojohlo merged commit 0a1f7fe into main Jul 8, 2026
6 checks passed
@timojohlo timojohlo deleted the feat/syslog-forwarded-by-attribute branch July 8, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants